package com.chujian.system.sys.controller;


import com.chujian.framework.core.base.BaseController;
import com.chujian.framework.core.base.BaseService;
import com.chujian.framework.core.tsdata.Result;
import com.chujian.sys.entity.SysUserLogin;
import com.chujian.system.sys.service.SysUserLoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 控制层
 *
 * @author yj
 * @since 2021-10-11
 */
@RequestMapping("/sysUserLogin")
@RestController
@Slf4j
public class SysUserLoginController extends BaseController<SysUserLogin> {

    @Resource
    private SysUserLoginService baseService;

    @Override
    public BaseService<SysUserLogin> getBaseService() {
        return baseService;
    }

    /**
     * 绑定系统微信用户
     *
     * @param userId
     * @param userLoginId
     * @return
     */
    @GetMapping("/bindSysWxUser")
    public Result<?> bindSysWxUser(@RequestParam("userId") Long userId,
                                   @RequestParam("userLoginId") Long userLoginId) {
        baseService.bindSysWxUser(userId, userLoginId);
        return okRs();
    }

}
